package com.itheima.api.treemap.demo01;

import java.util.TreeMap;

public class TreeMapDemo01 {

    public static void main(String[] args) {

        //TreeMap<String, String> treeMap = new TreeMap<String, String>();
        TreeMap<String, String> treeMap = new TreeMap<String, String>((o1, o2) -> o1.compareTo(o2));

        treeMap.put("bilibili", "北京");
        treeMap.put("aliali", "杭州");
        treeMap.put("cilicili", "重庆");

        treeMap.forEach((key, value) -> System.out.println(key + "----" + value));

    }

}
